package com.yytek.job.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.yytek.common.core.annotation.Excel;
import com.yytek.common.core.web.domain.BaseEntity;
import org.springframework.data.annotation.Transient;


import java.util.List;

/**
 * 任务模板对象 plan_task_template
 * 
 * @author yytek-iot
 * @date 2022-07-29
 */
@ApiModel("任务模板对象")
public class PlanTaskTemplate extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    @ApiModelProperty("id")
    private Long id;

    /** 绑定项目id */
    @Excel(name = "绑定项目id")
    @ApiModelProperty("绑定项目id")
    private Long projectId;

    /** 绑定产品id */
    @Excel(name = "绑定产品id")
    @ApiModelProperty("绑定产品id")
    private Long productId;

    /** 产品名称 */
    @Excel(name = "产品名称")
    @ApiModelProperty("产品名称")
    private String productName;

    /** 任务类型（1-状态采集 2-配置采集 3-操作采集） */
    @Excel(name = "任务类型", readConverterExp = "1=-状态采集,2=-配置采集,3=-操作采集")
    @ApiModelProperty("任务类型（1-状态采集 2-配置采集 3-操作采集）")
    private Integer taskType;

    /** 模板任务名称 */
    @Excel(name = "模板任务名称")
    @ApiModelProperty("模板任务名称")
    private String jobName;

    /** 调用目标唯一方法 */
    @Excel(name = "调用目标唯一方法")
    @ApiModelProperty("调用目标唯一方法")
    private String invokeTarget;

    /** 采集协议类型（MQTT/MODBUS/TCP） */
    @Excel(name = "采集协议类型", readConverterExp = "M=QTT/MODBUS/TCP")
    @ApiModelProperty("采集协议类型（MQTT/MODBUS/TCP）")
    private String protocolType;

    /** 关联设备策略（0-所有对应产品设备 1-关联模板设备 2-除关联模板设备外的所有设备） */
    @Excel(name = "关联设备策略", readConverterExp = "0=-所有对应产品设备,1=-关联模板设备,2=-除关联模板设备外的所有设备")
    @ApiModelProperty("关联设备策略（0-所有对应产品设备 1-关联模板设备 2-除关联模板设备外的所有设备）")
    private String deviceScope;

    /** 采集周期 */
    @Excel(name = "采集周期")
    @ApiModelProperty("采集周期")
    private String cronExpression;

    /** 状态(0-启用，1-禁用) */
    @Excel(name = "状态(0-启用，1-禁用)")
    @ApiModelProperty("状态(0-启用，1-禁用)")
    private Integer status;

    /** 超时时间 */
    @Excel(name = "超时时间")
    @ApiModelProperty("超时时间")
    private String timeout;

    /** 解析脚本类型(js) */
    @Excel(name = "解析脚本类型(js)")
    @ApiModelProperty("解析脚本类型(js)")
    private String decodertype;

    /** 解析脚本 */
    @Excel(name = "解析脚本")
    @ApiModelProperty("解析脚本")
    private String decoderScript;

    /** 发送内容 */
    @Excel(name = "发送内容")
    @ApiModelProperty("发送内容")
    private String sendContent;

    /** 额外替换内容 */
    @Excel(name = "额外替换内容")
    @ApiModelProperty("额外替换内容")
    private String conectContent;


    /** 模板绑定的设备列表 关联表*/
    @Transient
    @ApiModelProperty("模板绑定的设备列表")
    private List<PlanTemplateDeviceTopo> templateDeviceTopoList;

    public String getSendContent() {
        return sendContent;
    }

    public void setSendContent(String sendContent) {
        this.sendContent = sendContent;
    }

    public String getConectContent() {
        return conectContent;
    }

    public void setConectContent(String conectContent) {
        this.conectContent = conectContent;
    }

    public List<PlanTemplateDeviceTopo> getTemplateDeviceTopoList() {
        return templateDeviceTopoList;
    }

    public void setTemplateDeviceTopoList(List<PlanTemplateDeviceTopo> templateDeviceTopoList) {
        this.templateDeviceTopoList = templateDeviceTopoList;
    }

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setProjectId(Long projectId) 
    {
        this.projectId = projectId;
    }

    public Long getProjectId() 
    {
        return projectId;
    }
    public void setProductId(Long productId) 
    {
        this.productId = productId;
    }

    public Long getProductId() 
    {
        return productId;
    }
    public void setProductName(String productName) 
    {
        this.productName = productName;
    }

    public String getProductName() 
    {
        return productName;
    }
    public void setTaskType(Integer taskType) 
    {
        this.taskType = taskType;
    }

    public Integer getTaskType() 
    {
        return taskType;
    }
    public void setJobName(String jobName) 
    {
        this.jobName = jobName;
    }

    public String getJobName() 
    {
        return jobName;
    }
    public void setInvokeTarget(String invokeTarget) 
    {
        this.invokeTarget = invokeTarget;
    }

    public String getInvokeTarget() 
    {
        return invokeTarget;
    }
    public void setProtocolType(String protocolType) 
    {
        this.protocolType = protocolType;
    }

    public String getProtocolType() 
    {
        return protocolType;
    }
    public void setDeviceScope(String deviceScope) 
    {
        this.deviceScope = deviceScope;
    }

    public String getDeviceScope() 
    {
        return deviceScope;
    }
    public void setCronExpression(String cronExpression) 
    {
        this.cronExpression = cronExpression;
    }

    public String getCronExpression() 
    {
        return cronExpression;
    }
    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }
    public void setTimeout(String timeout) 
    {
        this.timeout = timeout;
    }

    public String getTimeout() 
    {
        return timeout;
    }
    public void setDecodertype(String decodertype) 
    {
        this.decodertype = decodertype;
    }

    public String getDecodertype() 
    {
        return decodertype;
    }
    public void setDecoderScript(String decoderScript) 
    {
        this.decoderScript = decoderScript;
    }

    public String getDecoderScript() 
    {
        return decoderScript;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("projectId", getProjectId())
            .append("productId", getProductId())
            .append("productName", getProductName())
            .append("taskType", getTaskType())
            .append("jobName", getJobName())
            .append("invokeTarget", getInvokeTarget())
            .append("protocolType", getProtocolType())
            .append("deviceScope", getDeviceScope())
            .append("cronExpression", getCronExpression())
            .append("status", getStatus())
            .append("timeout", getTimeout())
            .append("decodertype", getDecodertype())
            .append("decoderScript", getDecoderScript())
            .append("createTime", getCreateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
